package com.happy.zebra.admin.ui.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.happy.zebra.admin.ui.mapper.SmMemberOrderMapper;
import com.happy.zebra.admin.ui.service.SmMemberOrderService;
import com.shycloud.mido.common.core.util.R;
import com.shycloud.mido.member.api.entity.MemberOrder;
import com.shycloud.mido.member.api.vo.PayHistoryVORep;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;

@RestController
@AllArgsConstructor
@RequestMapping("/order")
public class OrderController {

	private final SmMemberOrderMapper memberOrderMapper;
	/** 订单业务 service */
	private final SmMemberOrderService orderService;

	@GetMapping("/getPayHistoryListDeposit")
	public R<IPage<PayHistoryVORep>> getPayHistoryListDeposit(String orgPhone, String orderNo, String fuwuOrderNo, Page page, String payMethod, String orderType, String status) {
		return new R<>(memberOrderMapper.getPayHistoryListDeposit(page, orderNo, fuwuOrderNo, payMethod, orderType, status, orgPhone));
	}

	@PostMapping("/updateOrder")
	public R<Boolean> updateOrder(@RequestBody MemberOrder memberOrder) {
		return new R<>(	orderService.updateOrder(memberOrder));
	}

}
